<%@ page language="java" contentType="text/html; charset=utf-8" %>
<%@ page import="com.alibaba.fastjson.JSONObject" %>
<%@ page import="weaver.general.Util" %>
<%@ page import="weaver.interfaces.cese.duss.ceseutil.CostUtil" %>
<jsp:useBean id="rs" class="weaver.conn.RecordSet" scope="page"/>
<jsp:useBean id="bb" class="weaver.general.BaseBean"/>
<%
    String sqrq = Util.null2String( request.getParameter( "sqrq" ) );
    String fykm = Util.null2String( request.getParameter( "fykm" ) );
    String yshd = Util.null2String( request.getParameter( "yshd" ) );
    String cblrzx = Util.null2String( request.getParameter( "cblrzx" ) );
    String requestid = Util.null2String( request.getParameter( "requestid" ) );
    String ysze = Util.null2String( request.getParameter( "ysze" ) );
    String yslx = Util.null2String( request.getParameter( "yslx" ) );
    double newysze = "".equals(ysze)? 0 :Double.valueOf(ysze);
    JSONObject jsonData = new JSONObject();
    String msg = "";
    boolean flag = true;
    double jdcbkyys = CostUtil.getYszxxKyys( yshd, fykm, cblrzx, sqrq );
    String fykmName = CostUtil.getFykmId2Name(fykm);//获取费用科目名称
    if ( jdcbkyys == 0) {
        flag = false;
        msg = "提示：费用科目为["+fykmName+"]没有季度成本可用预算";
    } else {
        double ysje = CostUtil.getYszxxxbYsje(requestid,yshd, fykm, cblrzx, sqrq, yslx);
            if (((jdcbkyys-ysje) - newysze) < 0) {
                flag = false;
                msg = "提示：预算总额不允许大于季度成本可用预算！";
            }

    }

    jsonData.put( "flag", flag );
    jsonData.put( "msg", msg );
    out.print( jsonData.toJSONString() );
    bb.writeLog( "getBussinessApply_Ajax=" + jsonData.toJSONString() );
%>



